﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BookingDetails.ascx.cs" Inherits="Web.BookingDetails" %>
<div style="width: 800px">
    <div class="Box">
        <div class="BoxTitle">
            <asp:Label ID="lblBookingTitle" runat="server"></asp:Label>
        </div>        
        <div class="BoxContent">
            <span style="font-size: 16px; font-weight: bold">Booking code:</asp:Label></span>
            <span style="font-size: 16px; font-weight: bold"><asp:Label ID="lblBookingCode" runat="server"></asp:Label></span>
        </div>
    </div>
    <div class="Box">
        <div class="BoxTitle">
            Thông tin hành trình
        </div>
        <div id="FlightDetail" runat="server" class="BoxContent">
            <div class="BoxFareOption" style="width: 780px;margin-bottom:0px">
                <div class="FlightContent">
                    <%--Departure--%>
                    <div class="FilghtItem">
                        <div class="FlightDirection">
                            Outbound flight:
                        </div>
                        <div class="FilghtInfo" style="border:none">
                            <div class="FlightInfoDetails">
                                <asp:Repeater ID="repDepartureFlightDetail" runat="server">
                                    <ItemTemplate>
                                        <table>
                                            <tr>
                                                <td class="Airline">
                                                    <img alt="Airline logo" src='<%# "/Images/Airline/" + ((Eval("AirlineDetail.Logo") == null) ? "default.png" : Eval("AirlineDetail.Logo")) %>' />
                                                </td>
                                                <td class="Point">
                                                    <div class="City">
                                                        <%# Eval("StartPointCity.Name_En")%>
                                                    </div>
                                                    <div class="Time">
                                                        <span class="TimeTitle">Departure time</span> <%# new IBE.Common().GetDate(Eval("StartDt").ToString(), Eval("StartTm").ToString()).ToString("HH:mm")%><br />
                                                        <span class="TimeTitle">Date</span> <%# new IBE.Common().GetDate(Eval("StartDt").ToString(), Eval("StartTm").ToString()).ToString("dd/MM/yyyy")%>
                                                    </div>
                                                </td>
                                                <td class="Point">
                                                    <div class="City">
                                                        <%# Eval("EndPointCity.Name_En") %>
                                                    </div>
                                                    <div class="Time">
                                                        <span class="TimeTitle">Arrival time</span> <%# new IBE.Common().GetDate(Eval("EndDt").ToString(), Eval("EndTm").ToString()).ToString("HH:mm")%><br />
                                                        <span class="TimeTitle">Date</span> <%# new IBE.Common().GetDate(Eval("EndDt").ToString(), Eval("EndTm").ToString()).ToString("dd/MM/yyyy")%>
                                                    </div>
                                                </td>
                                                <td class="Detail">
                                                    Airline: <b><%# Eval("OpAirlineDetail.Name_En") %></b><br />
                                                    Flight number: <b><%# (Eval("IBE") == "lowcost") ? "" : Eval("AirlineDetail.Code")%><%# Eval("FltNum").ToString()%></b><br />
                                                    Duration: <b><%# string.Format("{0}h {1}m", TimeSpan.FromMinutes(Convert.ToInt32(Eval("FltTm"))).Hours, TimeSpan.FromMinutes(Convert.ToInt32(Eval("FltTm"))).Minutes) %></b><br />
                                                    Class: <b><%# Eval("ClassAdult") != "" ? Eval("ClassAdult") : "-" %></b>
                                                </td>
                                            </tr>
                                        </table>

                                        <div style='<%# (Eval("IsLastItem").ToString() == "1") ? "display: none": "display: block" %>' class="StopBar">
                                            Stop at: <b><%# Eval("EndPointCity.Name_En")%> - <%# (Eval("EndPointAirport.Name_En") == Eval("EndPointAirport.Code")) ? "" : Eval("EndPointAirport.Name_En")%></b>
                                            - Stop time: <b><%# string.Format("{0}h {1}m", ((TimeSpan)Eval("StopTime")).Days * 24 + ((TimeSpan)Eval("StopTime")).Hours, ((TimeSpan)Eval("StopTime")).Minutes)%></b>
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </div>
                        </div>
                    </div>
                    <%--Return--%>
                    <asp:Panel ID="pnReturn" runat="server" Visible="false">
                        <div class="FilghtItem">
                            <div class="FlightDirection">
                                Inbound flight:
                            </div>
                            <div class="FilghtInfo" style="border:none">
                                <div class="FlightInfoDetails">
                                    <asp:Repeater ID="repReturnFlightDetail" runat="server">
                                        <ItemTemplate>
                                            <table>
                                                <tr>
                                                    <td class="Airline">
                                                        <img alt="Airline logo" src='<%# "/Images/Airline/" + ((Eval("AirlineDetail.Logo") == null) ? "default.png" : Eval("AirlineDetail.Logo")) %>' />
                                                    </td>
                                                    <td class="Point">
                                                        <div class="City">
                                                            <%# Eval("StartPointCity.Name_En")%>
                                                        </div>
                                                        <div class="Time">
                                                            <span class="TimeTitle">Departure time</span> <%# new IBE.Common().GetDate(Eval("StartDt").ToString(), Eval("StartTm").ToString()).ToString("HH:mm")%><br />
                                                            <span class="TimeTitle">Date</span> <%# new IBE.Common().GetDate(Eval("StartDt").ToString(), Eval("StartTm").ToString()).ToString("dd/MM/yyyy")%>
                                                        </div>
                                                    </td>
                                                    <td class="Point">
                                                        <div class="City">
                                                            <%# Eval("EndPointCity.Name_En") %>
                                                        </div>
                                                        <div class="Time">
                                                            <span class="TimeTitle">Arrival time</span> <%# new IBE.Common().GetDate(Eval("EndDt").ToString(), Eval("EndTm").ToString()).ToString("HH:mm")%><br />
                                                            <span class="TimeTitle">Date</span> <%# new IBE.Common().GetDate(Eval("EndDt").ToString(), Eval("EndTm").ToString()).ToString("dd/MM/yyyy")%>
                                                        </div>
                                                    </td>
                                                    <td class="Detail">
                                                        Airline: <b><%# Eval("OpAirlineDetail.Name_En") %></b><br />
                                                        Flight number: <b><%# (Eval("IBE") == "lowcost") ? "" : Eval("AirlineDetail.Code")%><%# Eval("FltNum").ToString()%></b><br />
                                                        Duration: <b><%# string.Format("{0}h {1}m", TimeSpan.FromMinutes(Convert.ToInt32(Eval("FltTm"))).Hours, TimeSpan.FromMinutes(Convert.ToInt32(Eval("FltTm"))).Minutes) %></b><br />
                                                        Class: <b><%# Eval("ClassAdult") != "" ? Eval("ClassAdult") : "-" %></b>
                                                    </td>
                                                </tr>
                                            </table>

                                            <div style='<%# (Eval("IsLastItem").ToString() == "1") ? "display: none": "display: block" %>' class="StopBar">
                                                Stop at: <b><%# Eval("EndPointCity.Name_En")%> - <%# (Eval("EndPointAirport.Name_En") == Eval("EndPointAirport.Code")) ? "" : Eval("EndPointAirport.Name_En")%></b>
                                                - Stop time: <b><%# string.Format("{0}h {1}m", ((TimeSpan)Eval("StopTime")).Days * 24 + ((TimeSpan)Eval("StopTime")).Hours, ((TimeSpan)Eval("StopTime")).Minutes)%></b>
                                            </div>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </div>
                            </div>
                        </div>
                    </asp:Panel>
                </div>
                <div class="Clear"></div>
            </div>
        </div>
    </div>
    <div class="Box">
        <div class="BoxTitle">
            Danh sách hành khách & chi tiết giá
        </div>
        <div class="BoxContent">
            <table style="width: 100%;">
                <tr>
                    <td style="width:30px;text-align: center">
                        <b>STT</b>
                    </td>
                    <td style="width: 100px;">
                        <b>Loại khách</b>
                    </td>
                    <td style="width: 100px;text-align: center">
                        <b>Giới tính</b>
                    </td>
                    <td style="width: 230px;text-align: left">
                        <b>Họ & Tên</b>
                    </td>
                    <td style="width: 100px;text-align: center">
                        <b>Ngày sinh</b>
                    </td>
                    <td style="width: 130px;text-align: right">
                        <b>Giá vé</b>
                    </td>
                </tr>
                <asp:Repeater ID="repPax" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td style="text-align: center">
                                <%# Convert.ToInt32(DataBinder.Eval(Container, "ItemIndex")) + 1 %>
                            </td>
                            <td>
                                <%# Eval("tblPassengerType.Name_En") %>
                            </td>
                            <td style="text-align: center">
                                <%# bool.Parse(Eval("Gender").ToString()) ? "Nam" : "Nữ" %>
                            </td>
                            <td>
                                <%# Eval("FirstName").ToString() + " " + Eval("LastName").ToString() %>
                            </td>
                            <td style="text-align: center">
                                <%# (Eval("PassengerType").ToString() != "ADT") ? DateTime.Parse(Eval("Birthday").ToString()).ToString("dd-MM-yyyy") : "-" %>
                            </td>
                            <td style="text-align: right">
                                <b><%# (Convert.ToDouble(Eval("Price")) + Convert.ToDouble(Eval("Fee"))).ToString("#,0.##") %> <%# Eval("tblBooking.CurrencyCode") %></b>
                                </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
                <tr>
                    <td colspan="5" style="text-align: right">
                        <strong>Tổng giá</strong>
                    </td>
                    <td class="TotalPrice">
                        <asp:Label ID="lblGrandTotal" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="Box">
        <div class="BoxTitle">
            Thông tin liên hệ
        </div>
        <div class="BoxContent">
            <table style="width: 100%;">
                <tr>
                    <td style="width: 150px">Quý danh:</td>
                    <td>
                        <asp:Label ID="lblContactTitle" runat="server"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>Họ tên:</td>
                    <td>
                        <asp:Label ID="lblName" runat="server"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>Số điện thoại:</td>
                    <td>
                        <asp:Label ID="lblPhone" runat="server"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>Email:</td>
                    <td>
                        <asp:Label ID="lblEmail" runat="server"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>Địa chỉ:</td>
                    <td>
                        <asp:Label ID="lblAddress" runat="server"></asp:Label>
                    </td>
                </tr>
                
                <tr>
                    <td>Yêu cầu đặc biệt:</td>
                    <td>
                        <asp:Label ID="lblNote" runat="server"></asp:Label>
                    </td>
                </tr>
                
            </table>
        </div>
        </div>
    </div>